<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr =[1,2,3]
        /* 
        1.数组的每一项是基础(简单)类型，执行map不会改变数组原来的结构
        2.数组的每一项为复杂类型，会改变原来的数据结构
        */
        var res = arr.map(item =>{
            return item*3
        })
        console.log(res);
        console.log(arr);

        var obj =[
            {name:"liu",age:10},
            {name:"zhang",age:11}
        ]
        var result = obj.map(item =>{
            return item.age = 0;
        })
        console.log(result);
        console.log(obj);
    </script>
</body>
</html>